{% extends base.html %}

{% block body_left %}

{% init title = T("线程列表") %}
{% include system/component/thread_nav.html %}

<style type="text/css">
    th.no {
        width: 10%;
    }
    th.name {
        width: 40%;
    }
    th.detail {
        width: 30%;
    }
    th.options {
        width: 20%;
    }
</style>

<div class="card">

    <table class="table" border="border:#ff6600 1px solid">
        <tr>
            <th class="no">编号</th>
            <th class="name">Name</th>
            <th class="detail">处理器</th>
            <th class="options">操作</th>
        </tr>
    {% for idx,thread in enumerate(thread_list) %}
        <tr>       
            <td>{{idx+1}}</td>
            <td>{{thread.getName()}}</td> 
            <td>{{get_handler_name(thread)}}</td>
            <td>
                <a class="view-detail" data-value="{{thread.__dict__}}">详情</a>
            </td>
        </tr>
    {% end %}
    </table>
</div>

<script type="text/javascript">
$(function () {
    $(".view-detail").click(function (e) {
        var value = $(this).attr("data-value");
        var html  = $("<div>").addClass("card").text(value);
        xnote.showDialog("线程详情", html.prop("outerHTML"), ["确定"]);
    });
})
</script>

{% end %}

{% block body_right %}
    {% include system/component/admin_nav.html %}
{% end %}